home *** CD-ROM | disk | FTP | other *** search
/ 95.86.62.111 / 95.86.62.111.tar / 95.86.62.111 / Active Sync 4.5.rar / Active Sync 4.5 / setup.msi / ActiveSync.cab / activesync.chm.48F17E76_FD07_4BE3_97CE_1B27523FD30B / scripts / dtue_ie4.js < prev    next >
Text File  |  2006-10-01  |  6KB  |  146 lines

  1. // VERSION 9226
  2. // This script works with IE4.x
  3.  
  4. //************************** LOCALIZATION VARIABLES ***************************
  5.  
  6. // Variables for Feedback links
  7. var L_FeedbackLink_TEXT = "Send feedback to Visual Studio";
  8. var L_MessageLink_TEXT = "Microsoft Knowledgebase Link";
  9.  
  10. // Variable for Animation text
  11. var L_Animation_Text = "Click to animate";
  12.  
  13. // Variables for Expand-Collapse functions
  14. var L_ExpandAll_TEXT = "Expand All";
  15. var L_CollapseAll_TEXT = "Collapse All";
  16. var L_ExColl_TEXT = "Click to Expand or Collapse";
  17.  
  18. //*************************** END LOCALIZATION ********************************
  19.  
  20. var theImg, theDiv, e;
  21. var imgArray = new Array(new Image(), new Image(), new Image(), new Image(), new Image());
  22. var baseUrl = jsPath; //jsPath comes from the dtuelink.js
  23. var emailalias = "vsdocs";
  24.  
  25. //***************************** END VARIABLES *********************************
  26.  
  27.  
  28. // ****************************************************************************
  29. // *                             Expand-Collapse                              *
  30. // ****************************************************************************
  31.  
  32. function makeExpandable(title, level){
  33.     if (title!="")document.write("<a href=\"\#\" onClick='callExpand()' id=\"ExPand\" Class=\"expandLink" + level + "\"><IMG CLASS=\"ExPand\" SRC=\"" + baseUrl + "coe.gif\" HEIGHT=9 WIDTH=9 ALT=\"" + L_ExColl_TEXT + "\" BORDER=0> " + title + "</a><BR><div CLASS=\"expandBody" + level + "\">");
  34.     else document.write("<a href=\"\#\" id=\"ExPandAll\" onClick='callExpandAll()' Class=\"expandLink" + level + "\"><IMG CLASS=\"ExPandAll\" SRC=\"" + baseUrl + "coe.gif\" HEIGHT=9 WIDTH=9 ALT=\"" + L_ExColl_TEXT + "\" BORDER=0> " + L_ExpandAll_TEXT + "</A>");
  35. }
  36.  
  37. function getImage(){
  38.     for (var a = 0; a < 7; a++){
  39.           if ((e.tagName != 'A') && (e.parentElement != null)){e = e.parentElement;}
  40.         var elemImg = e;
  41.         if(elemImg.tagName == 'A'){elemImg = e.all.tags('IMG')(0); break;}}
  42. return elemImg;}
  43.  
  44. function callExpand(){
  45. //DO EXPAND/COLLAPSE
  46.     e = window.event.srcElement;
  47.  
  48.     //PREVENTS NAVIGATION ON HREF TAGS
  49.     event.returnValue = false;
  50.  
  51.     //FIND THE EXPAND/COLLAPSE PORTION AND ASCERTAIN BLOCK VS NONE
  52.     var theDiv = GrabtheExpandDiv(e);
  53.         
  54.     //THIS PART WRITES THE PROPER IMAGE BESIDE THE TEXT
  55.     if (theDiv.style.display == 'block'){
  56.         var theImg = getImage(e);
  57.         theImg.src = baseUrl + "coe.gif";
  58.         theDiv.style.display = "none";}
  59.     else {
  60.         var theImg = getImage(e);
  61.         theImg.src = baseUrl + "coc.gif";
  62.         theDiv.style.display = "block";}
  63. return;
  64. }
  65.  
  66. function GrabtheExpandDiv(e){
  67. //FIND AREA TO EXPAND/COLLAPSE
  68.     var theExpandDiv;
  69.     for (var a = 0; a < 7; a++){
  70.         var theTag = e.sourceIndex + e.children.length + a;
  71.         theExpandDiv= document.all(theTag);
  72.          if (((theExpandDiv.tagName == 'DIV') && ((theExpandDiv.className.toLowerCase().indexOf("expandbody")!=-1))) || theTag == document.all.length){break;}}
  73. return theExpandDiv;
  74. }
  75.  
  76. function callExpandAll(){
  77.     e = window.event.srcElement;
  78.     //PREVENTS NAVIGATION ON HREF TAGS
  79.     event.returnValue = false;
  80.     if (e.tagName=="IMG") e = e.parentElement;
  81.     //Expand or Collapse?
  82.     if (e.innerHTML.indexOf(L_ExpandAll_TEXT) != -1){eOrC="block"}else{eOrC="none"}
  83.     if (eOrC=="block"){
  84.         e.innerHTML="<IMG CLASS='ExPand' SRC=\"" + baseUrl + "coc.gif\" HEIGHT='9' WIDTH='9' ALT='" + L_ExColl_TEXT + "' BORDER='0'> " + L_CollapseAll_TEXT;}
  85.     else{
  86.         e.innerHTML="<IMG CLASS='ExPand' SRC=\"" + baseUrl + "coe.gif\" HEIGHT='9' WIDTH='9' ALT='" + L_ExColl_TEXT + "' BORDER='0'> " + L_ExpandAll_TEXT;}
  87.     for (var a = 0; a < document.all.length; a++){ 
  88.         e=document.all[a];
  89.  
  90.         if (e.id.indexOf('ExPand') != -1){
  91.  
  92.             if (e.id.indexOf('ExPandAll') == -1){
  93.  
  94.             var theDiv = GrabtheExpandDiv(e);
  95.             if (eOrC == 'none'){
  96.                 theImg = getImage(e);
  97.                 theImg.src = baseUrl + "coe.gif";
  98.                 theDiv.style.display = eOrC;}
  99.             else {
  100.                 theImg = getImage(e);
  101.                 theImg.src = baseUrl + "coc.gif";
  102.                 theDiv.style.display = eOrC;}
  103.             }
  104.         }
  105.     }
  106. return;
  107. }
  108.  
  109.  
  110. // ****************************************************************************
  111. // *                            Graphic Animation                             *
  112. // ****************************************************************************
  113.  
  114. function insertAnimation(name, number) {
  115.     imgArray[number].src = name + ".gif";
  116.     document.write("<input type=\"image\" src=\"" + baseUrl + "AnimButton1.gif\" onClick=\"changeToAnimate('" + name + "', " + number + ");\" onMouseDown=\"src='" + baseUrl + "AnimButton2.gif';\" onMouseUp=\"src='" + baseUrl + "AnimButton1.gif';\"> " + L_Animation_Text + "<br><br><img name=\"" + name + "\" src=\"" + name + "1.gif\">");
  117.     }
  118.  
  119. function changeToAnimate(imgName, number) {
  120.     document[imgName].src = imgArray[number].src;
  121.     }
  122.  
  123.  
  124. // ****************************************************************************
  125. // *                        Feedback & other footer links                     *
  126. // ****************************************************************************
  127.  
  128. function writefeedbacklink(){
  129.     //writes feedback link
  130.     contextid = arguments[1];
  131.     topictitle = arguments[2];
  132.  
  133.     href = "mailto:"+emailalias+"?subject=Feedback%20on%20topic%20-%20"+topictitle+",%20URL%20-%20"+contextid;
  134.     document.writeln("<a href="+href+">"+L_FeedbackLink_TEXT+"</a>");
  135. }
  136.  
  137.  
  138. function writemessagelink(){
  139.     //Writes jump to PSS web site redirector
  140.     //code tbd
  141.     //Use L_MessageLink_TEXT variable from Localization Variables located at top of script.
  142.     msdnid = arguments[0];
  143.     href = "http://www.microsoft.com/contentredirect.asp?prd=vs&pver=7.0&id="+msdnid;
  144.     document.writeln("<a href="+href+">"+L_MessageLink_TEXT+"</a>");
  145. }
  146.